package com.component.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.system.job.QuartzStatusEnum;
import com.system.job.QuartzTimeEnum;
import lombok.Data;

/**
 * 
 * @TableName m_job
 */
@TableName(value ="m_job")
@Data
public class MJob implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    private String jobname;

    /**
     * 
     */
    private String cron;

    /**
     * 
     */
    private String tigger;

    /**
     * 
     */
    private String clazz;

    /**
     * 
     */
    private String note;

    /**
     * 
     */
    private Integer deleted;

    /**
     * 
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    /**
     * 
     */
    private Date updatetime;

    /**
     * 
     */
    private Integer version;

    /**
     * 
     */
    private String type;

    /**
     * 
     */
    private String methodname;

    /**
     * 
     */
    private String groupName;

    /**
     * 
     */
    private String params;

    /**
     * 
     */
    private String timetype;

    /**
     * 
     */
    private String status;

    @TableField(exist = false)
    private String statuName;

    public String getStatuName() {
        if(this.status!=null){
            QuartzStatusEnum[] enums=QuartzStatusEnum.values();
            for(QuartzStatusEnum en:enums){
                if(en.getStatus().equals(status)){
                    this.statuName = en.getStatusName();
                    break;
                }
            }
        }
        return statuName;
    }

    @TableField("methodclazz")
    private String methodclazz;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}